package com.bone.order.dao;

import java.util.List;
import java.util.Map;

import com.bone.common.BaseIbatisDAO;
import com.bone.order.po.OrdSaleService;
import com.bone.page.Page;

public class OrdSaleServiceDAO extends BaseIbatisDAO {
	
	/**
	 * 取符合查询条件的数据.
	 * @param parameter
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public Page<OrdSaleService> queryOrdSaleServicePageByParam(Map<String, Object> para,Page page){     
		Long totalResultSize = (Long) getSqlMapClientTemplate().queryForObject("ORD_SALE_SERVICE.queryCountOrdSaleServiceByParam", para);
		page.setTotalResultSize(totalResultSize);				
		para.put("startRows", page.getStartRows());				
		para.put("endRows", page.getEndRows());
		para.put("_order", "order_no");
		page.setItems(getSqlMapClientTemplate().queryForList("ORD_SALE_SERVICE.queryOrdSaleServicePageByParam", para));
		return page;
	}
	
	
	/**
	 * 
	 * @param orderNo
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<OrdSaleService> queryOrdSaleServiceListByOrderNo(Long orderNo){
		return getSqlMapClientTemplate().queryForList("ORD_SALE_SERVICE.queryOrdSaleServiceListByOrderNo", orderNo);
	}
	
	/**
	 * 
	 * @param refundmentId
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public OrdSaleService queryOrdSaleServiceListById(Long serviceId){
		return (OrdSaleService)getSqlMapClientTemplate().queryForObject("ORD_SALE_SERVICE.queryOrdSaleServiceById", serviceId);
	}
}
